export default arr => {
  arr.sort()
  let parity = [],
    odd = 1,
    even = 0

  arr.forEach(item => {
    if (item % 2 === 1) {
      parity[odd] = item
      odd += 2
    } else {
      parity[even] = item
      even += 2
    }
  })

  return parity
}
